package com.jh.user.business;

import cn.jh.common.exception.ServiceException;
import com.jh.user.pojo.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface UserBankInfoBusiness {
    /**
     * 通过银行卡号修改用户信息
     */
    public void updateUserBankInfoByCardno(String bankBranchName, String province, String city, String lineNo, String securityCode, String expiredTime, String bankno);

    /**
     * 查询默认银行卡
     * @param userId
     * @param idDef
     * @return
     */
    public UserBankInfo findUserBankInfoByUseridAndIdDef(long userId,String idDef,String type);

    /**
     * 通过用户的id获取用户的卡片信息
     */
    public List<UserBankInfo> queryUserBankInfoByUserid(long userid);

    /**
     * 通过用户的id获取用户的卡片信息
     */
    public List<UserBankInfo> queryUserBankInfoByUserid(long userid, String type);

    /***获取用户的默任结算卡信息*/
    public UserBankInfo queryDefUserBankInfoByUserid(long userid);


    /**
     * 根据卡号获取用户的基本信息
     */
    public UserBankInfo queryUserBankInfoByCardno(String cardno, String type);

    /**
     * 根据卡号获取用户的基本信息
     * Type
     */
    public UserBankInfo queryUserBankInfoByCardnoType(String cardno, String type);

    /**
     * 根据卡号查到银行卡信息
     * @param cardno
     * @return
     */
    public UserBankInfo findUserBankInfoByCardNo(String cardno);

    /**
     * 根据联行号获取用户的基本卡信息
     */
    public UserBankInfo queryUserBankInfoByLineno(String lineno);

    /**
     * 生成银行账号信息
     */
    public UserBankInfo saveUserBankInfo(UserBankInfo bankInfo);

    public void updateAllNoDefault(long userid, String type);

    /**
     * 设置默认卡
     */
    public UserBankInfo setDefaultBank(long userid, String cardno);

    /**
     * 根据银行名称获取银行编号
     */
    public BankNumber queryBankNumberByBankName(String bankName);

    /**
     * 根据银行名称获取银行缩写
     */
    public BankAcronym queryBankAcronymByBankName(String bankName);

    /**
     * 根据userId查询用户银行卡的nature
     *
     * @return
     */
    public List<UserBankInfo> findNatureByUserId(long userId);

    /**
     * 查询用户卡( card_type为信用卡 ) by user id
     *
     * @return
     */
    public List<UserBankInfo> findLikeCardTypeByUserId(long userId);

    /***
     *
     * @param userId
     * @param cardNo
     * @param type
     * @return 李梦珂
     */
    public UserBankInfo queryBankNameByUserIdAndCardNo(long userId, String cardNo, String type);

    /**
     * 根据userId和bankNo查询用户银行卡信息
     *
     * @param userId
     * @param cardNo
     * @return
     */
    public List<UserBankInfo> findUserBankInfoByUseridAndCardno(long userId, String cardNo);

    /*获取银行支行名*/
    public UserBankInfo findBankNumberBybankbranchname(String bankbranchName, String cardNo);

    public int queryCountByUserIdAndCardNoAndCardType(Long userId, String bankCardNumber, String cardType);


    public UserBankInfo query(Long userId, String bankCardNumber);

    public UserBankInfo findUserBankInfoByUserIdAndCardNoAndState(Long valueOf, String creditCardNumber, String state, String type);

    //通过userId更新银行卡状态
    public void updateBankCardByUserId(long userId);

    //根据banklocation去查对应的清算行号
    public UserBankNo findBankNoByBankLocation(String bankLocation);

    void updateBankLineNo(String bankNo, long userId,String bankcard);

    /**
     * 根据银行卡号修改预留手机号
     ***/
    void updateUserBankPhonebyCardno(String cardNo, String phone);

    void updateUserBankInfo(UserBankInfo userBankInfo);

    UserBankInfo getUserBankInfo(String bankcard);

    UserBankInfo findCreditCardManagerConfig (String brandId);

    UserBankInfo findUserId(long userId);

    UserBankInfo isBandingBankCard(long userId, String bankcard);

    List<UserBankInfo> getAvailBankCardList(long userId, String channelTag, String debitCard) throws ServiceException;

    BankBranch getBankBranchList(String topName);

    Boolean supportChannel(String bankAbbr, String channelId) throws ServiceException;

    List<Map<String, Object>> getBindBankInfoByUserId(long userId);

    UserBankInfo queryDefBankInfoByUserid(long userId);

    UserBankInfo addUserBankCardInfo(UserBankInfo bankInfo, MultipartFile bankCardPhoto) throws ServiceException;

    void updateUserBankCardInfo(UserBankInfo userBankInfo, MultipartFile bankCardPhoto) throws ServiceException;
}
